package cn.rkylin.oms.aftersale.sysreturn.dao;

import cn.rkylin.oms.aftersale.sysreturn.domain.SysReturnSku;

import java.util.List;

public interface ISysReturnSkuDAO {
    int deleteByPrimaryKey(String refundSkuId);

    int insert(SysReturnSku record) throws Exception;

    int insertSelective(SysReturnSku record);

    SysReturnSku selectByPrimaryKey(String returnSkuId) throws Exception;

    /**
     * 更新系统退货单商品明细
     *
     * @param record
     * @return
     * @throws Exception
     */
    int updateByPrimaryKeySelective(SysReturnSku record) throws Exception;

    int updateByPrimaryKey(SysReturnSku record);

    /**
     * insertNotExist:如果Sku不存在，则插入记录. <br/>
     *
     * @param sysReturnSku
     * @return int
     * @throws Exception
     * @author zhanghao
     */
    int insertNotExistSku(SysReturnSku sysReturnSku) throws Exception;

    /**
     * deleteByAutoSysReturnID:根据自动退货单ID删除明细. <br/>
     *
     * @param returnId
     * @return
     * @throws Exception
     * @author zhanghao
     */
    int deleteByAutoSysReturnID(String returnId) throws Exception;

    /**
     * 获取系统退货单商品明细
     *
     * @param returnId
     * @return
     * @throws Exception
     */
    public List<SysReturnSku> selectByReturnId(String returnId) throws Exception;

    /**
     * 判断退货单的来源单据的发货单是否已发货
     *
     * @param returnId
     * @return
     * @throws Exception
     */
    public List<SysReturnSku> apprCheckCountByReturnId(String returnId) throws Exception;

    /**
     * 判断退货单的来源单据的发货单是否商品已经发货
     *
     * @param returnId
     * @return
     * @throws Exception
     */
    public List<SysReturnSku> apprCheckShiporderSkuByReturnId(String returnId) throws Exception;

    public List<SysReturnSku> selectByReturnSkuIdSysReturnSku(String returnSkuId) throws Exception;

    /**
     * 判断商品是否关联过 菜鸟商品
     *
     * @param sysReturnSku
     * @return
     * @throws Exception
     */
    public List<SysReturnSku> selectSysReturnSkuForCainiao(SysReturnSku sysReturnSku) throws Exception;
}